package com.ddky.pophome.wight;

import android.content.Context;
import android.view.ViewGroup;

import com.ddky.pophome.R;

import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView;

import java.util.List;

/**
 * description：
 * Author: 许少东
 * Created: 2/22/21 4:22 PM
 */
public class HomeTabTitleView extends ColorTransitionPagerTitleView {
    private List<String> mTitleDataList;
    private int index;
    public HomeTabTitleView(Context context, List<String> mTitleDataList,int index) {
        super(context);
        this.mTitleDataList = mTitleDataList;
        this.index = index;
    }

    @Override
    public void onSelected(int index, int totalCount) {
        super.onSelected(index, totalCount);
        setBackground(getResources().getDrawable(R.drawable.shape_home_tab_select_bg));
        setTextColor(getResources().getColor(R.color.white));
    }

    @Override
    public void onDeselected(int index, int totalCount) {
        super.onDeselected(index, totalCount);
        setBackground(getResources().getDrawable(R.drawable.shape_home_tab_normal_bg));
        setTextColor(getResources().getColor(R.color.c_e94544));
    }
}
